﻿using drawing_print.comm;
using drawing_print.configure;
using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace drawing_print
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            //Application.EnableVisualStyles();
            //Application.SetCompatibleTextRenderingDefault(false);
            //Application.Run(new Form1());

            Application.EnableVisualStyles();
            //Application.SetCompatibleTextRenderingDefault(false);
            // 设置开机自启
            RegistryKey R_local = Registry.LocalMachine;//RegistryKey R_local = Registry.CurrentUser;
            RegistryKey R_run = R_local.CreateSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Run");
            R_run.SetValue("drawubg-print", Application.ExecutablePath);
            R_run.Close();
            R_local.Close();
            // 启动服务
            AppConfig.isWork = false;
            ServerHelper serverHelper = new ServerHelper();
            serverHelper.Setup(55555);
            Application.Run();
            
        }
    }
}
